package com.compty.paint.web.member;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;

import com.compty.core.framework.context.spring.SpringContextHolder;
import com.compty.core.framework.util.StringUtil;
import com.compty.core.struts2.BaseAction;
import com.compty.paint.domain.AuditState;
import com.compty.paint.domain.CatalogType;
import com.compty.paint.domain.CityInfo;
import com.compty.paint.domain.ImageInfo;
import com.compty.paint.domain.LogInfo;
import com.compty.paint.domain.Market_index;
import com.compty.paint.domain.Painter;
import com.compty.paint.domain.Painting;
import com.compty.paint.domain.ProvinceInfo;
import com.compty.paint.domain.UploadState;
import com.compty.paint.domain.support.LogTypeEnum;
import com.compty.paint.manager.AuditStateManager;
import com.compty.paint.manager.CatalogTypeManager;
import com.compty.paint.manager.CityInfoManager;
import com.compty.paint.manager.ImageInfoManager;
import com.compty.paint.manager.LogInfoManager;
import com.compty.paint.manager.MarketIndexManager;
import com.compty.paint.manager.PainterManager;
import com.compty.paint.manager.PaintingManager;
import com.compty.paint.manager.ProvinceInfoManager;
import com.compty.paint.manager.UploadStateManager;
import com.compty.paint.util.Constants;
import com.compty.security.domain.User;
import com.compty.security.manager.UserManager;

/**
 * @Todo:画家相关处理Action
 * @author: zhuqh
 * @CreateTime:2011-7-26 下午07:57:38
 */
public class PainterAction extends BaseAction<Painter> {

	private static final long serialVersionUID = -5056647551536030642L;
	
	private CatalogTypeManager catalogTypeManager; //一级分类
	private transient UserManager userManager = null;
	private LogInfoManager logInfoManager;
	private ImageInfoManager imageInfoManager;
	
	private List<CatalogType> catalogTypeList;
	private List<ProvinceInfo> provinceInfoList;
	private List<CityInfo> cityInfoList;
	private PainterManager painterManager;
	private PaintingManager paintingManager;
	private AuditStateManager auditStateManager;
	private UploadStateManager uploadStateManager;
	private ProvinceInfoManager provinceInfoManager;
	private CityInfoManager cityInfoManager;
	
	// ====================================================
	private User userInfo;
	private Painter painter;
	private Date startDate;
	private Date endDate;
	private String operateStr; //1表示隐藏,2表示删除,3：审核通过 ,4:审核驳回,5:显示
	private String auditStateType; //审核类型(供查询之用)
	
	/**
	 *@Todo:新增预处理
	 *@author:zhuqh
	 *@CreateTime:2011-6-9 下午05:05:07
	 */
	public String addPrepare(){
		
		this.painter = null;
		
		this.catalogTypeList = catalogTypeManager.getAll();
		
		this.provinceInfoList = provinceInfoManager.getAll();
		
		return SUCCESS;
	}
	
	/**
	 *@Todo:艺术家会员 资料补充
	 *@CreateTime:2011-8-29 上午09:19:28
	 * @throws IOException
	 */
	public String savePainterMember() throws IOException{
		
		if(painter != null){
			User userInfo = (User) session.getAttribute(Constants.RegisterInformation);
			painter.setUploadTime(Calendar.getInstance().getTime());
			painter.setModifyTime(Calendar.getInstance().getTime());
			
			if(Constants.Auto_Audit){
				AuditState auditState = auditStateManager.findUniqueBy("english_name",Constants.Audit_State_Pass);
				painter.setAuditState(auditState);
			}else{
				AuditState auditState = auditStateManager.findUniqueBy("english_name",Constants.Audit_State_Init);
				painter.setAuditState(auditState);
			}
			
			UploadState  uploadState = uploadStateManager.findUniqueBy("english_name", Constants.Upload_State_Init); //上传状态，是否锁定，隐藏等
			painter.setUploadState(uploadState);
			
			if(painter.getProvinceInfo() == null || painter.getProvinceInfo().getId()== null){
				painter.setProvinceInfo(null);
			}
			if(painter.getCityInfo() == null || painter.getCityInfo().getId() == null ){
				painter.setCityInfo(null);
			}
			painterManager.save(painter);
			
			userManager.save(userInfo);
			
			painter.setEntryPerson(userInfo);
			painterManager.save(painter);
			
			this.userInfo = userInfo;
		}
		
		return "completeRegister";
	}
	
	/**
	 *@Todo:保存艺术家资料
	 *@CreateTime:2011-6-9 下午08:12:37
	 * @throws IOException
	 */
	public String save() throws Exception{
		
		if(painter != null){
			if(painter.getId() == null){
				User userInfo = (User) session.getAttribute(Constants.Userinfo);
				painter.setEntryPerson(userInfo);
				painter.setModifyPerson(userInfo);
			}else{
				User userInfo = (User) session.getAttribute(Constants.Userinfo);
				painter.setModifyPerson(userInfo);
			}
			
			painter.setUploadTime(Calendar.getInstance().getTime());
			painter.setModifyTime(Calendar.getInstance().getTime());
			
			if(Constants.Auto_Audit){
				AuditState auditState = auditStateManager.findUniqueBy("english_name",Constants.Audit_State_Pass);
				painter.setAuditState(auditState);
			}else{
				AuditState auditState = auditStateManager.findUniqueBy("english_name",Constants.Audit_State_Init);
				painter.setAuditState(auditState);
			}
			
			UploadState  uploadState = uploadStateManager.findUniqueBy("english_name", Constants.Upload_State_Init); //上传状态，是否锁定，隐藏等
			painter.setUploadState(uploadState);
			
			if(painter.getProvinceInfo() == null || painter.getProvinceInfo().getId()== null){
				painter.setProvinceInfo(null);
			}
			if(painter.getCityInfo() == null || painter.getCityInfo().getId() == null ){
				painter.setCityInfo(null);
			}
			
			String type = painter.getType();
			if( "2".equals(type) ){
				
				List<Market_index> marketList = buildMaket_index();
				MarketIndexManager marketIndexManager = SpringContextHolder.getBean("marketIndexManager");
			
				Market_index market1 = marketList.get(0);
				marketIndexManager.save(market1);
				
				Market_index market2 = marketList.get(1);
				marketIndexManager.save(market2);
				
				Market_index market3 = marketList.get(2);
				marketIndexManager.save(market3);
				
				Market_index market4 = marketList.get(3);
				marketIndexManager.save(market4);
				
				painter.setNewIndex(market1);
				painter.setMaxIndex(market2);
				painter.setMinIndex(market3);
				painter.setNewestIndex(market4);
			}
			
			painterManager.save(painter);
			generateImageOfPainterAfterSaved(painter.getImageInfo());//生成画家图片
			
			LogInfo logInfo = buildLogInfo(LogTypeEnum.addPainter, "保存艺术家"+painter.getName()+"基本资料成功");
			logInfoManager.writeLog(logInfo);
		}
		
		return SUCCESS;
	}
	
	/**
	 * 补充艺术家资料
	 * @throws IOException
	 */
	public String save_additional() throws Exception{
		
		if(painter != null){
			
			User userInfo = (User) session.getAttribute(Constants.Userinfo);
			
			String painterName = painter.getName();
			List<Painter>  painterList = painterManager.findByPainterNameAndEntryPerson(painterName,userInfo);
			if(painterList != null && painterList.size()>0 ){
				
				request.setAttribute("ajaxData", "0001"+","+painterName+",该用户名已存在");
				return SUCCESS;
			}
			
			painter.setEntryPerson(userInfo);
			painter.setUploadTime(Calendar.getInstance().getTime());
			painter.setModifyTime(Calendar.getInstance().getTime());
			
			if(Constants.Auto_Audit){
				AuditState auditState = auditStateManager.findUniqueBy("english_name",Constants.Audit_State_Pass);
				painter.setAuditState(auditState);
			}else{
				AuditState auditState = auditStateManager.findUniqueBy("english_name",Constants.Audit_State_Init);
				painter.setAuditState(auditState);
			}
			
			UploadState  uploadState = uploadStateManager.findUniqueBy("english_name", Constants.Upload_State_Init); //上传状态，是否锁定，隐藏等
			painter.setUploadState(uploadState);
			
			if(painter.getProvinceInfo() == null || painter.getProvinceInfo().getId()== null){
				painter.setProvinceInfo(null);
			}
			if(painter.getCityInfo() == null || painter.getCityInfo().getId() == null ){
				painter.setCityInfo(null);
			}
			
			painterManager.save(painter);
			generateImageOfPainterAfterSaved(painter.getImageInfo());//生成画家图片
			
			request.setAttribute("ajaxData", "0000"+","+painter.getId()+","+painter.getName());
			LogInfo logInfo = buildLogInfo(LogTypeEnum.addPainter, "保存艺术家"+painter.getName()+"基本资料成功");
			logInfoManager.writeLog(logInfo);
		}
		
		return SUCCESS;
	}
	
	/**
	 *@Todo:查询当代画家
	 *@CreateTime:2011-10-12 下午12:58:48
	 * @return
	 */
	public String listPainter(){
		
		this.catalogTypeList = catalogTypeManager.getAll();
		
		String catalogTypeSelect = request.getParameter("catalogTypeSelect");
		
		int catalogtype_id = 0;
		if(catalogTypeSelect != null && StringUtil.isDigit(catalogTypeSelect)){
			catalogtype_id = Integer.parseInt(catalogTypeSelect);
		}
		
		User userInfo = (User) session.getAttribute(Constants.Userinfo);
		
        this.page = painterManager.findPainterByPage("1", startDate, endDate, userInfo, auditStateType, filterTxt, filterValue,catalogtype_id, curPage, pageSize);
        
        request.setAttribute("cur_catalogtype_id", catalogtype_id);
        
        return SUCCESS;
	}
	
	/**
	 *@Todo:列出名家
	 *@author:zhuqh
	 *@CreateTime:2011-10-12 下午12:57:57
	 * @return
	 */
	public String listPainterStar(){
		
		User userInfo = (User) session.getAttribute(Constants.Userinfo);
		
		if("test".equals(userInfo.getUsername())){
			userInfo = null;
		}
	    
		this.page = painterManager.findPainterByPage("2", startDate, endDate, userInfo, auditStateType, filterTxt, filterValue,null, curPage, pageSize);
	        
	    return SUCCESS;
	}

	/**
	 *@Todo:展现艺术家详情
	 *@author:zhuqh
	 *@CreateTime:2011-6-9 上午09:46:18
	 */
	public String modifyPrepare(){
		
		this.provinceInfoList = provinceInfoManager.getAll();
		
		if(painter != null){
			this.catalogTypeList = catalogTypeManager.getAll();
			
			Long id = painter.getId();
			this.painter = painterManager.get(id);
		}
		
		return SUCCESS;
	}
	
	/**
	 * 显示艺术家详情及作品信息
	 *@author:zhuqh
	 *@CreateTime:2011-8-3 上午09:55:23
	 * @return
	 */
	public String showDetail(){
		
		this.provinceInfoList = provinceInfoManager.getAll();
		
		if( painter != null){
			this.catalogTypeList = catalogTypeManager.getAll();
			Long id = painter.getId();
			this.painter = painterManager.get(id);
			
			List<Painting> paintingList = paintingManager.findPaintingsByPainter(id);
			request.setAttribute("paintingList", paintingList);
		}
		
		return "painter_detail";
	}
	
	/**
	 * 修改画家信息
	 *@author:zhuqh
	 *@CreateTime:2011-6-9 上午10:19:01
	 * @return
	 */
	public String modify() throws Exception{
		
		if(painter != null){
			
			Painter p = painterManager.get(painter.getId());
			
			User userInfo = (User) session.getAttribute(Constants.Userinfo);
			p.setModifyPerson(userInfo);
			p.setModifyTime(Calendar.getInstance().getTime());
			
			if(Constants.Auto_Audit){
				AuditState auditState = auditStateManager.findUniqueBy("english_name",Constants.Audit_State_Pass);
				p.setAuditState(auditState);
			}else{
				AuditState auditState = auditStateManager.findUniqueBy("english_name",Constants.Audit_State_Init);
				p.setAuditState(auditState);
			}
			
			p.setName(painter.getName());
			p.setEnglishName(painter.getEnglishName());
			p.setZi(painter.getZi());
			p.setHao(painter.getHao());
			p.setCatalogType(painter.getCatalogType());
			p.setImageInfo(painter.getImageInfo());
			p.setAge(painter.getAge());
			p.setGraduatedFrom(painter.getGraduatedFrom());
			p.setHonour(painter.getHonour());
			p.setProvinceInfo(painter.getProvinceInfo());
			p.setCityInfo(painter.getCityInfo());
			p.setDescription(painter.getDescription());
			
			p.setType(painter.getType());
			p.setAddress(painter.getAddress());
			p.setDecade(painter.getDecade());
			
			if(painter.getProvinceInfo() == null || painter.getProvinceInfo().getId()== null){
				p.setProvinceInfo(null);
			}
			if(painter.getCityInfo() == null || painter.getCityInfo().getId() == null ){
				p.setCityInfo(null);
			}
			
			String type = p.getType();
			if("2".equals(type)){ //表示名家
				
				List<Market_index> marketList = buildMaket_index();
				MarketIndexManager marketIndexManager = SpringContextHolder.getBean("marketIndexManager");
				
				long new_id = p.getNewIndex() == null ? 0 : p.getNewIndex().getId();
				long max_id = p.getMaxIndex() == null ? 0 : p.getMaxIndex().getId();
				long min_id = p.getMinIndex() == null ? 0: p.getMinIndex().getId();
				long newest_id = p.getNewestIndex() == null ? 0: p.getNewestIndex().getId();
				
				Market_index market1 = marketList.get(0);
				marketIndexManager.save(market1);
				
				Market_index market2 = marketList.get(1);
				marketIndexManager.save(market2);
				
				Market_index market3 = marketList.get(2);
				marketIndexManager.save(market3);
				
				Market_index market4 = marketList.get(3);
				marketIndexManager.save(market4);
				
				p.setNewIndex(market1);
				p.setMaxIndex(market2);
				p.setMinIndex(market3);
				p.setNewestIndex(market4);
				
				/****************删除原有的市场行情指数数据  begin *********************/
				marketIndexManager.removeById(new_id);
				marketIndexManager.removeById(max_id);
				marketIndexManager.removeById(min_id);
				marketIndexManager.removeById(newest_id);
				/****************删除原有的市场行情指数数据  end *********************/
			}
			
			painterManager.save(p);
			generateImageOfPainterAfterSaved(p.getImageInfo());
			
			request.setAttribute("ajaxData", "0000"+","+p.getId()+","+p.getName());
			LogInfo logInfo = buildLogInfo(LogTypeEnum.modifyPainter, "修改艺术家"+p.getName()+"基本资料成功");
			logInfoManager.writeLog(logInfo);
		}
		
		return SUCCESS;
	}
	
	/**
	 *@Todo:改变状态
	 *@author:zhuqh
	 *@CreateTime:2011-6-9 上午10:19:17
	 */
	public String changeUploadState() throws Exception{
		
		if(painter != null){
			Long id = painter.getId();
			this.painter = painterManager.get(id);
			
			if("1".equals(operateStr)){ //隐藏
				
				painterManager.hiddenPainter(id);
				
				LogInfo logInfo = buildLogInfo(LogTypeEnum.modifyPainter, "修改艺术家"+painter.getName()+"基本资料,operate：隐藏");
				logInfoManager.writeLog(logInfo);
				
			}else if("2".equals(operateStr)){//删除
				painterManager.removeById(id);
				
				LogInfo logInfo = buildLogInfo(LogTypeEnum.deletePainter, "删除艺术家"+painter.getName()+"基本资料");
				logInfoManager.writeLog(logInfo);
			}
			else if("3".equals(operateStr)){
				AuditState auditState = auditStateManager.findUniqueBy("english_name", Constants.Audit_State_Pass);  //审核通过
				painter.setAuditState(auditState);
				painter.setModifyTime(Calendar.getInstance().getTime());
				painterManager.save(painter);
				
				LogInfo logInfo = buildLogInfo(LogTypeEnum.audit_pass_painter, "审核通过艺术家"+painter.getName()+"基本资料");
				logInfoManager.writeLog(logInfo);
			}
			else if("4".equals(operateStr)){
				AuditState auditState = auditStateManager.findUniqueBy("english_name", Constants.Audit_State_Overrule);  //审核驳回
				painter.setAuditState(auditState);
				painter.setModifyTime(Calendar.getInstance().getTime());
				painterManager.save(painter);
				
				LogInfo logInfo = buildLogInfo(LogTypeEnum.audit_overrule_painter, "审核驳回艺术家"+painter.getName()+"基本资料");
				logInfoManager.writeLog(logInfo);
			}
			else if("5".equals(operateStr)){//显示
				UploadState uploadState = uploadStateManager.findUniqueBy("english_name", Constants.Upload_State_Init);
				painter.setUploadState(uploadState);
				painter.setModifyTime(Calendar.getInstance().getTime());
				painterManager.save(painter);
				
				LogInfo logInfo = buildLogInfo(LogTypeEnum.modifyPainter, "修改艺术家"+painter.getName()+"基本资料,operate：显示");
				logInfoManager.writeLog(logInfo);
			}
			else if("6".equals(operateStr)){//置顶
				painter.setSortFlag(1);
				painter.setOrderNo(0);
				painterManager.save(painter);
				LogInfo logInfo = buildLogInfo(LogTypeEnum.modifyPainter, "修改艺术家"+painter.getName()+"基本资料,operate：置顶");
				logInfoManager.writeLog(logInfo);
			}
			else if("7".equals(operateStr)){//取消置顶
				painter.setSortFlag(0);
				painter.setOrderNo(null);
				painterManager.save(painter);
				LogInfo logInfo = buildLogInfo(LogTypeEnum.modifyPainter, "修改艺术家"+painter.getName()+"基本资料,operate：取消置顶");
				logInfoManager.writeLog(logInfo);
			}
		}
		
		request.setAttribute("ajaxData", "0000");
		
		return SUCCESS;
	}
	
	/**
	 * 由艺术家姓名查找
	 *@author:zhuqh
	 *@CreateTime:2011-7-6 下午02:36:40
	 * @return
	 */
	public String findPainterByName(){
		String name = request.getParameter("painter_name");
		try {
			name = URLDecoder.decode(name,"utf-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		
		User user = (User) session.getAttribute(Constants.Userinfo);
		
		List<Painter> list = null;
		if("1".equals(user.getAdministratorFlag())){ //管理员操作
			list = painterManager.findByPainterName(name);
		}else{//非管理员（即会员）操作
			list = painterManager.findByPainterNameAndEntryPerson(name,user);
		}
		
		if(list!=null && list.size()>0){
			Painter painter = list.get(0);
			if( painter != null){
				request.setAttribute("ajaxData", painter.getId().toString());
			}
		}else{
			request.setAttribute("ajaxData", "0");
		}
		
		return "findByName";
	}
	
	/**
	 * 由省份查找城市
	 *@author:zhuqh
	 *@CreateTime:2011-7-26 下午03:05:14
	 */
	@SuppressWarnings("unchecked")
	public String findCityByProvinceId(){
		
		String p_id = request.getParameter("p_Id");
		Long provinceId = Long.valueOf(p_id);
		
		List<CityInfo> cityInfos = cityInfoManager.findCityByProvinceId(provinceId);
		
		List<Map> returnList = new ArrayList<Map>();
		for (CityInfo cityInfo : cityInfos) {
			Map map = new HashMap();
			map.put("id", cityInfo.getId());
			map.put("name", cityInfo.getName());
			returnList.add(map);
		}

		String ajaxData = JSONArray.fromObject(returnList).toString();
		request.setAttribute("ajaxData", ajaxData);
		
		return "cityList";
	}
	
	/**
	 *@Todo:列出可用的艺术家
	 *@CreateTime:2011-10-28 下午03:03:40
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public String listAvailablePainterList(){
		
		User userInfo = (User) session.getAttribute(Constants.Userinfo);
		List<Painter> painterList = painterManager.findByEntryPerson(userInfo.getId(),userInfo.getAdministratorFlag()) ;
		
		List<Map> returnList = new ArrayList<Map>();
		for (Painter painter : painterList) {
			Map map = new HashMap();
			map.put("id", painter.getId());
			map.put("name", painter.getName());
			returnList.add(map);
		}
		
		String ajaxData = JSONArray.fromObject(returnList).toString();
		request.setAttribute("ajaxData", ajaxData);
		
		return "availablePainterList";
	}
	
	/**
	* @Description: 更改排序
	 */
	public String changeSequence(){
		String data = request.getParameter("data");
		if( data!= null && !data.equals("")){
			String[] arr = data.split("\\}\\,\\{");
			for (int i = 0; i < arr.length; i++) {
				String item = arr[i].replace("{", "").replace("}", "");
				String[] objArray = item.split(",");
				String idStr = objArray[0];
				String numberStr = objArray[1];
				
				Painter painter = painterManager.get(Long.valueOf(idStr));
				
				painter.setOrderNo(Integer.valueOf(numberStr));
				painterManager.save(painter);
			}
		}
		
		request.setAttribute("ajaxData", "0000");
		return "changeSequence";
	}
	
	public  List<Market_index> buildMaket_index(){
		String time_period_1 = request.getParameter("time_period_1");
		String time_period_2 = request.getParameter("time_period_2");
		String time_period_3 = request.getParameter("time_period_3");
		String time_period_4 = request.getParameter("time_period_4");
		
		String price_1 = request.getParameter("price_1") == null ? "" : request.getParameter("price_1");
		String price_2 = request.getParameter("price_2") == null ? "" : request.getParameter("price_2");
		String price_3 = request.getParameter("price_3") == null ? "" : request.getParameter("price_3");
		String price_4 = request.getParameter("price_4") == null ? "" : request.getParameter("price_4");
		
		Market_index marketIndex_1 = new Market_index();
		marketIndex_1.setTime_period(time_period_1);
		marketIndex_1.setPrice(price_1);
		
		Market_index marketIndex_2 = new Market_index();
		marketIndex_2.setTime_period(time_period_2);
		marketIndex_2.setPrice(price_2);
		
		Market_index marketIndex_3 = new Market_index();
		marketIndex_3.setTime_period(time_period_3);
		marketIndex_3.setPrice(price_3);
		
		Market_index marketIndex_4 = new Market_index();
		marketIndex_4.setTime_period(time_period_4);
		marketIndex_4.setPrice(price_4);
		
		List<Market_index>  list = new ArrayList<Market_index>();
		list.add(marketIndex_1);
		list.add(marketIndex_2);
		list.add(marketIndex_3);
		list.add(marketIndex_4);
		
		return list;
	}
	
	private void generateImageOfPainterAfterSaved(ImageInfo img) throws Exception{
		
		if( img != null){
			img = imageInfoManager.get(img.getId());
			generateImageOfPainterFirstTime(img);
		}
	}
	
	public String getOperateStr() {
		return operateStr;
	}
	public void setOperateStr(String operateStr) {
		this.operateStr = operateStr;
	}

	public void setCatalogTypeManager(CatalogTypeManager catalogTypeManager) {
		this.catalogTypeManager = catalogTypeManager;
	}
	
	public void setCatalogTypeList(List<CatalogType> catalogTypeList) {
		this.catalogTypeList = catalogTypeList;
	}
	
	public List<CatalogType> getCatalogTypeList() {
		return catalogTypeList;
	}

	public void setPainterManager(PainterManager painterManager) {
		this.painterManager = painterManager;
	}

	public Painter getPainter() {
		return painter;
	}

	public void setPainter(Painter painter) {
		this.painter = painter;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public void setAuditStateManager(AuditStateManager auditStateManager) {
		this.auditStateManager = auditStateManager;
	}

	public void setUploadStateManager(UploadStateManager uploadStateManager) {
		this.uploadStateManager = uploadStateManager;
	}
	
	public String getAuditStateType() {
		return auditStateType;
	}

	public void setAuditStateType(String auditStateType) {
		this.auditStateType = auditStateType;
	}

	public List<ProvinceInfo> getProvinceInfoList() {
		return provinceInfoList;
	}

	public void setProvinceInfoList(List<ProvinceInfo> provinceInfoList) {
		this.provinceInfoList = provinceInfoList;
	}

	public List<CityInfo> getCityInfoList() {
		return cityInfoList;
	}

	public void setCityInfoList(List<CityInfo> cityInfoList) {
		this.cityInfoList = cityInfoList;
	}
	
	public void setProvinceInfoManager(ProvinceInfoManager provinceInfoManager) {
		this.provinceInfoManager = provinceInfoManager;
	}

	public void setCityInfoManager(CityInfoManager cityInfoManager) {
		this.cityInfoManager = cityInfoManager;
	}

	public void setUserManager(UserManager userManager) {
		this.userManager = userManager;
	}

	public void setUserInfo(User userInfo) {
		this.userInfo = userInfo;
	}

	public User getUserInfo() {
		return userInfo;
	}

	public void setLogInfoManager(LogInfoManager logInfoManager) {
		this.logInfoManager = logInfoManager;
	}

	public void setImageInfoManager(ImageInfoManager imageInfoManager) {
		this.imageInfoManager = imageInfoManager;
	}
	
	public void setPaintingManager(PaintingManager paintingManager) {
		this.paintingManager = paintingManager;
	}
}
